// 导入express模块
const express = require('express')
// 创建应用
const app = express()

function logger(options) {
    return function (req, res, next) {
        const logs = []
        console.log(`${options.method}`);
        next()
    }
}


app.get('/', logger({method: 'good'}), (req, res) => {
    res.send('Hello world')
})

app.get('/user', (req, res) => {
    res.send('abin is good')
})


app.listen(8899, () => {
    console.log('listen on 8899');
})